using System;
using System.Data;
using System.Data.OleDb;
using System.Runtime.InteropServices;
using PCSComUtils.Common;
using PCSComUtils.DataAccess;

using PCSComUtils.PCSExc;

namespace PCSComProduct.Costing.DS
{
	[Guid("9FCD59B3-5334-4ffb-943C-B86007955060")]
	public class ITM_CostOperationDS//:IObjectDS 
	{
		public ITM_CostOperationDS()
		{
		}
		private const string THIS = "PCSComProduct.Costing.DS.ITM_CostOperationDS";

	
		//**************************************************************************              
		///    <Description>
		///       This method uses to add data to ITM_CostOperation
		///    </Description>
		///    <Inputs>
		///        ITM_CostOperationVO       
		///    </Inputs>
		///    <Outputs>
		///       newly inserted primarkey value
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************


		public void Add(object pobjObjectVO)
		{
			const string METHOD_NAME = THIS + ".Add()";
			 
			OleDbConnection oconPCS =null;
			OleDbCommand ocmdPCS =null;
			try
			{
				ITM_CostOperationVO objObject = (ITM_CostOperationVO) pobjObjectVO;
				string strSql = String.Empty;
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand("", oconPCS);
				
				strSql=	"INSERT INTO ITM_CostOperation("
				+ ITM_CostOperationTable.COMMATERIAL01_FLD + ","
				+ ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD + ","
				+ ITM_CostOperationTable.COMMACHINESETUP03_FLD + ","
				+ ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD + ","
				+ ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD + ","
				+ ITM_CostOperationTable.COMMACHINERUN06_FLD + ","
				+ ITM_CostOperationTable.COMMACHINEFIXED07_FLD + ","
				+ ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD + ","
				+ ITM_CostOperationTable.COMLABORSETUP09_FLD + ","
				+ ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD + ","
				+ ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD + ","
				+ ITM_CostOperationTable.COMLABORRUN12_FLD + ","
				+ ITM_CostOperationTable.COMLABORFIXED13_FLD + ","
				+ ITM_CostOperationTable.COMLABORVARIABLE14_FLD + ","
				+ ITM_CostOperationTable.COMOUTSIDEPROC15_FLD + ","
				+ ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD + ","
				+ ITM_CostOperationTable.COMSHRINK17_FLD + ","
				+ ITM_CostOperationTable.COMFREIGHT18_FLD + ","
				+ ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD + ","
				+ ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD + ","
				+ ITM_CostOperationTable.COMTOTALAMOUNT21_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTSHRINK17_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD + ","
				+ ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD + ","
				+ ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD + ","
				+ ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.BCR_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTSHRINK17_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD + ","
				+ ITM_CostOperationTable.ROUTINGID_FLD + ","
				+ ITM_CostOperationTable.CCNID_FLD + ","
				+ ITM_CostOperationTable.PRODUCTID_FLD + ")"
				+ "VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMATERIAL01_FLD].Value = objObject.ComMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD].Value = objObject.ComMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINESETUP03_FLD].Value = objObject.ComMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD].Value = objObject.ComMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD].Value = objObject.ComMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINERUN06_FLD].Value = objObject.ComMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINEFIXED07_FLD].Value = objObject.ComMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD].Value = objObject.ComMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORSETUP09_FLD].Value = objObject.ComLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD].Value = objObject.ComLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD].Value = objObject.ComLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORRUN12_FLD].Value = objObject.ComLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORFIXED13_FLD].Value = objObject.ComLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORVARIABLE14_FLD].Value = objObject.ComLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMOUTSIDEPROC15_FLD].Value = objObject.ComOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD].Value = objObject.ComAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMSHRINK17_FLD].Value = objObject.ComShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMFREIGHT18_FLD].Value = objObject.ComFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD].Value = objObject.ComUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD].Value = objObject.ComUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMTOTALAMOUNT21_FLD].Value = objObject.ComTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD].Value = objObject.VAddCostMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD].Value = objObject.VAddCostMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD].Value = objObject.VAddCostMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD].Value = objObject.VAddCostMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD].Value = objObject.VAddCostMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD].Value = objObject.VAddCostMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD].Value = objObject.VAddCostMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD].Value = objObject.VAddCostMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD].Value = objObject.VAddCostLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD].Value = objObject.VAddCostLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD].Value = objObject.VAddCostLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD].Value = objObject.VAddCostLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD].Value = objObject.VAddCostLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD].Value = objObject.VAddCostLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD].Value = objObject.VAddCostOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD].Value = objObject.VAddCostAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTSHRINK17_FLD].Value = objObject.VAddCostShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD].Value = objObject.VAddCostFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD].Value = objObject.VAddCostUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD].Value = objObject.VAddCostUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD].Value = objObject.VAddCostTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD].Value = objObject.ComponentLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD].Value = objObject.ComponentLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD].Value = objObject.ComponentMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD].Value = objObject.ComponentMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD].Value = objObject.ValueAddedLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD].Value = objObject.ValueAddedLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD].Value = objObject.ValueAddedMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD].Value = objObject.ValueAddedMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD].Value = objObject.OperationLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD].Value = objObject.OperationLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD].Value = objObject.OperationMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD].Value = objObject.OperationMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.BCR_FLD, OleDbType.VarChar));
				ocmdPCS.Parameters[ITM_CostOperationTable.BCR_FLD].Value = objObject.BCR;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD].Value = objObject.OperCostMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD].Value = objObject.OperCostMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD].Value = objObject.OperCostMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD].Value = objObject.OperCostMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD].Value = objObject.OperCostMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD].Value = objObject.OperCostMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD].Value = objObject.OperCostMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD].Value = objObject.OperCostMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD].Value = objObject.OperCostLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD].Value = objObject.OperCostLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD].Value = objObject.OperCostLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD].Value = objObject.OperCostLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD].Value = objObject.OperCostLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD].Value = objObject.OperCostLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD].Value = objObject.OperCostOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD].Value = objObject.OperCostAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTSHRINK17_FLD].Value = objObject.OperCostShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD].Value = objObject.OperCostFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD].Value = objObject.OperCostUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD].Value = objObject.OperCostUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD].Value = objObject.OperCostTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.ROUTINGID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostOperationTable.ROUTINGID_FLD].Value = objObject.RoutingID;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.CCNID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostOperationTable.CCNID_FLD].Value = objObject.CCNID;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.PRODUCTID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostOperationTable.PRODUCTID_FLD].Value = objObject.ProductID;


				
				ocmdPCS.CommandText = strSql;
				ocmdPCS.Connection.Open();
				ocmdPCS.ExecuteNonQuery();	

			}
			catch(OleDbException ex)
			{
				if (ex.Errors[1].NativeError == ErrorCode.SQLDUPLICATE_KEYCODE)
				{
																   
					throw new PCSDBException(ErrorCode.DUPLICATE_KEY, METHOD_NAME, ex);				
				}
				else
				{
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
				}
			}			

			catch(InvalidOperationException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}
			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}
		}
	

		//**************************************************************************              
		///    <Description>
		///       This method uses to add data to ITM_CostOperation
		///    </Description>
		///    <Inputs>
		///        ITM_CostOperationVO       
		///    </Inputs>
		///    <Outputs>
		///       newly inserted primarkey value
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       DungLa
		///    </Authors>
		///    <History>
		///       01-Apr-2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public int AddAndReturnID(object pobjObjectVO)
		{
			const string METHOD_NAME = THIS + ".AddAndReturnID()";
			 
			OleDbConnection oconPCS =null;
			OleDbCommand ocmdPCS =null;
			try
			{
				ITM_CostOperationVO objObject = (ITM_CostOperationVO) pobjObjectVO;
				string strSql = String.Empty;
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand("", oconPCS);
				
				strSql=	"INSERT INTO ITM_CostOperation("
					+ ITM_CostOperationTable.COMMATERIAL01_FLD + ","
					+ ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostOperationTable.COMMACHINESETUP03_FLD + ","
					+ ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD + ","
					+ ITM_CostOperationTable.COMMACHINERUN06_FLD + ","
					+ ITM_CostOperationTable.COMMACHINEFIXED07_FLD + ","
					+ ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD + ","
					+ ITM_CostOperationTable.COMLABORSETUP09_FLD + ","
					+ ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD + ","
					+ ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostOperationTable.COMLABORRUN12_FLD + ","
					+ ITM_CostOperationTable.COMLABORFIXED13_FLD + ","
					+ ITM_CostOperationTable.COMLABORVARIABLE14_FLD + ","
					+ ITM_CostOperationTable.COMOUTSIDEPROC15_FLD + ","
					+ ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostOperationTable.COMSHRINK17_FLD + ","
					+ ITM_CostOperationTable.COMFREIGHT18_FLD + ","
					+ ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD + ","
					+ ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD + ","
					+ ITM_CostOperationTable.COMTOTALAMOUNT21_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTSHRINK17_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD + ","
					+ ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD + ","
					+ ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD + ","
					+ ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD + ","
					+ ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD + ","
					+ ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD + ","
					+ ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD + ","
					+ ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD + ","
					+ ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD + ","
					+ ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD + ","
					+ ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD + ","
					+ ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD + ","
					+ ITM_CostOperationTable.BCR_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTSHRINK17_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostOperationTable.ROUTINGID_FLD + ","
					+ ITM_CostOperationTable.CCNID_FLD + ","
					+ ITM_CostOperationTable.PRODUCTID_FLD + ")"
					+ "VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";

				strSql += "; SELECT @@IDENTITY AS NEWID";

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMATERIAL01_FLD].Value = objObject.ComMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD].Value = objObject.ComMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINESETUP03_FLD].Value = objObject.ComMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD].Value = objObject.ComMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD].Value = objObject.ComMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINERUN06_FLD].Value = objObject.ComMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINEFIXED07_FLD].Value = objObject.ComMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD].Value = objObject.ComMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORSETUP09_FLD].Value = objObject.ComLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD].Value = objObject.ComLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD].Value = objObject.ComLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORRUN12_FLD].Value = objObject.ComLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORFIXED13_FLD].Value = objObject.ComLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORVARIABLE14_FLD].Value = objObject.ComLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMOUTSIDEPROC15_FLD].Value = objObject.ComOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD].Value = objObject.ComAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMSHRINK17_FLD].Value = objObject.ComShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMFREIGHT18_FLD].Value = objObject.ComFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD].Value = objObject.ComUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD].Value = objObject.ComUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMTOTALAMOUNT21_FLD].Value = objObject.ComTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD].Value = objObject.VAddCostMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD].Value = objObject.VAddCostMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD].Value = objObject.VAddCostMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD].Value = objObject.VAddCostMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD].Value = objObject.VAddCostMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD].Value = objObject.VAddCostMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD].Value = objObject.VAddCostMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD].Value = objObject.VAddCostMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD].Value = objObject.VAddCostLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD].Value = objObject.VAddCostLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD].Value = objObject.VAddCostLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD].Value = objObject.VAddCostLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD].Value = objObject.VAddCostLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD].Value = objObject.VAddCostLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD].Value = objObject.VAddCostOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD].Value = objObject.VAddCostAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTSHRINK17_FLD].Value = objObject.VAddCostShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD].Value = objObject.VAddCostFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD].Value = objObject.VAddCostUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD].Value = objObject.VAddCostUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD].Value = objObject.VAddCostTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD].Value = objObject.ComponentLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD].Value = objObject.ComponentLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD].Value = objObject.ComponentMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD].Value = objObject.ComponentMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD].Value = objObject.ValueAddedLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD].Value = objObject.ValueAddedLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD].Value = objObject.ValueAddedMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD].Value = objObject.ValueAddedMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD].Value = objObject.OperationLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD].Value = objObject.OperationLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD].Value = objObject.OperationMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD].Value = objObject.OperationMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.BCR_FLD, OleDbType.VarChar));
				ocmdPCS.Parameters[ITM_CostOperationTable.BCR_FLD].Value = objObject.BCR;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD].Value = objObject.OperCostMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD].Value = objObject.OperCostMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD].Value = objObject.OperCostMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD].Value = objObject.OperCostMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD].Value = objObject.OperCostMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD].Value = objObject.OperCostMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD].Value = objObject.OperCostMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD].Value = objObject.OperCostMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD].Value = objObject.OperCostLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD].Value = objObject.OperCostLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD].Value = objObject.OperCostLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD].Value = objObject.OperCostLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD].Value = objObject.OperCostLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD].Value = objObject.OperCostLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD].Value = objObject.OperCostOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD].Value = objObject.OperCostAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTSHRINK17_FLD].Value = objObject.OperCostShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD].Value = objObject.OperCostFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD].Value = objObject.OperCostUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD].Value = objObject.OperCostUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD].Value = objObject.OperCostTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.ROUTINGID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostOperationTable.ROUTINGID_FLD].Value = objObject.RoutingID;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.CCNID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostOperationTable.CCNID_FLD].Value = objObject.CCNID;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.PRODUCTID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostOperationTable.PRODUCTID_FLD].Value = objObject.ProductID;


				
				ocmdPCS.CommandText = strSql;
				ocmdPCS.Connection.Open();
				return int.Parse(ocmdPCS.ExecuteScalar().ToString());
				//ocmdPCS.ExecuteNonQuery();
			}
			catch(OleDbException ex)
			{
				if (ex.Errors.Count > 0)
				{
					if (ex.Errors[1].NativeError == ErrorCode.SQLDUPLICATE_KEYCODE)
					{
																   
						throw new PCSDBException(ErrorCode.DUPLICATE_KEY, METHOD_NAME, ex);				
					}
					else
					{
						throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
					}
				}
				else
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}			

			catch(InvalidOperationException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}
			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}
		}
	

	

		//**************************************************************************              
		///    <Description>
		///       This method uses to delete data from ITM_CostOperation
		///    </Description>
		///    <Inputs>
		///        ID       
		///    </Inputs>
		///    <Outputs>
		///       void
		///    </Outputs>
		///    <Returns>
		///       
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       09-Dec-2004
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************

		public void Delete(int pintID)
		{
			const string METHOD_NAME = THIS + ".Delete()";
			string strSql = String.Empty;
			strSql=	"DELETE " + ITM_CostOperationTable.TABLE_NAME + " WHERE  " + "CostOperationID" + "=" + pintID.ToString();
			OleDbConnection oconPCS=null;
			OleDbCommand ocmdPCS =null;
			try
			{
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);

				ocmdPCS.Connection.Open();
				ocmdPCS.ExecuteNonQuery();	
				ocmdPCS = null;

			}
			catch(OleDbException ex)
			{
				if (ex.Errors[1].NativeError == ErrorCode.SQLCASCADE_PREVENT_KEYCODE)
				{
																   
					throw new PCSDBException(ErrorCode.CASCADE_DELETE_PREVENT, METHOD_NAME, ex);				
				}
				else
				{
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
				}
			}			

			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}



			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}
		}
	

	

		//**************************************************************************              
		///    <Description>
		///       This method uses to get data from ITM_CostOperation
		///    </Description>
		///    <Inputs>
		///        ID       
		///    </Inputs>
		///    <Outputs>
		///       ITM_CostOperationVO
		///    </Outputs>
		///    <Returns>
		///       ITM_CostOperationVO
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************

		public object GetObjectVO(int pintID)
		{
			const string METHOD_NAME = THIS + ".GetObjectVO()";
			DataSet dstPCS = new DataSet();
			
			OleDbDataReader odrPCS = null;
			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try 
			{
				string strSql = String.Empty;
				strSql=	"SELECT "
				+ ITM_CostOperationTable.COSTOPERATIONID_FLD + ","
				+ ITM_CostOperationTable.COMMATERIAL01_FLD + ","
				+ ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD + ","
				+ ITM_CostOperationTable.COMMACHINESETUP03_FLD + ","
				+ ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD + ","
				+ ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD + ","
				+ ITM_CostOperationTable.COMMACHINERUN06_FLD + ","
				+ ITM_CostOperationTable.COMMACHINEFIXED07_FLD + ","
				+ ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD + ","
				+ ITM_CostOperationTable.COMLABORSETUP09_FLD + ","
				+ ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD + ","
				+ ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD + ","
				+ ITM_CostOperationTable.COMLABORRUN12_FLD + ","
				+ ITM_CostOperationTable.COMLABORFIXED13_FLD + ","
				+ ITM_CostOperationTable.COMLABORVARIABLE14_FLD + ","
				+ ITM_CostOperationTable.COMOUTSIDEPROC15_FLD + ","
				+ ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD + ","
				+ ITM_CostOperationTable.COMSHRINK17_FLD + ","
				+ ITM_CostOperationTable.COMFREIGHT18_FLD + ","
				+ ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD + ","
				+ ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD + ","
				+ ITM_CostOperationTable.COMTOTALAMOUNT21_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTSHRINK17_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD + ","
				+ ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD + ","
				+ ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD + ","
				+ ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.BCR_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTSHRINK17_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD + ","
				+ ITM_CostOperationTable.ROUTINGID_FLD + ","
				+ ITM_CostOperationTable.CCNID_FLD + ","
				+ ITM_CostOperationTable.PRODUCTID_FLD
				+ " FROM " + ITM_CostOperationTable.TABLE_NAME
				+" WHERE " + ITM_CostOperationTable.COSTOPERATIONID_FLD + "=" + pintID;

				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);

				ocmdPCS.Connection.Open();
				odrPCS = ocmdPCS.ExecuteReader();

				ITM_CostOperationVO objObject = new ITM_CostOperationVO();

				while (odrPCS.Read())
				{ 
				objObject.CostOperationID = int.Parse(odrPCS[ITM_CostOperationTable.COSTOPERATIONID_FLD].ToString().Trim());
				objObject.ComMaterial01 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMATERIAL01_FLD].ToString().Trim());
				objObject.ComMaterialOverHead02 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD].ToString().Trim());
				objObject.ComMachineSetup03 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMACHINESETUP03_FLD].ToString().Trim());
				objObject.ComMachineSetupFixed04 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD].ToString().Trim());
				objObject.ComMachineSetupVar05 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD].ToString().Trim());
				objObject.ComMachineRun06 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMACHINERUN06_FLD].ToString().Trim());
				objObject.ComMachineFixed07 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMACHINEFIXED07_FLD].ToString().Trim());
				objObject.ComMachineVariable08 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD].ToString().Trim());
				objObject.ComLaborSetup09 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMLABORSETUP09_FLD].ToString().Trim());
				objObject.ComLaborSetupFixed10 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD].ToString().Trim());
				objObject.ComLaborSetupVariable11 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD].ToString().Trim());
				objObject.ComLaborRun12 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMLABORRUN12_FLD].ToString().Trim());
				objObject.ComLaborFixed13 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMLABORFIXED13_FLD].ToString().Trim());
				objObject.ComLaborVariable14 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMLABORVARIABLE14_FLD].ToString().Trim());
				objObject.ComOutsideProc15 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMOUTSIDEPROC15_FLD].ToString().Trim());
				objObject.ComAssemblyScrap16 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD].ToString().Trim());
				objObject.ComShrink17 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMSHRINK17_FLD].ToString().Trim());
				objObject.ComFreight18 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMFREIGHT18_FLD].ToString().Trim());
				objObject.ComUserStandard1_19 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD].ToString().Trim());
				objObject.ComUserStandard2_20 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD].ToString().Trim());
				objObject.ComTotalAmount21 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMTOTALAMOUNT21_FLD].ToString().Trim());
				objObject.VAddCostMaterial01 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD].ToString().Trim());
				objObject.VAddCostMaterialOverHead02 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD].ToString().Trim());
				objObject.VAddCostMachineSetup03 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD].ToString().Trim());
				objObject.VAddCostMachineSetupFixed04 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD].ToString().Trim());
				objObject.VAddCostMachineSetupVar05 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD].ToString().Trim());
				objObject.VAddCostMachineRun06 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD].ToString().Trim());
				objObject.VAddCostMachineFixed07 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD].ToString().Trim());
				objObject.VAddCostMachineVariable08 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD].ToString().Trim());
				objObject.VAddCostLaborSetup09 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD].ToString().Trim());
				objObject.VAddCostLaborSetupFixed10 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD].ToString().Trim());
				objObject.VAddCostLaborSetupVariable11 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD].ToString().Trim());
				objObject.VAddCostLaborRun12 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD].ToString().Trim());
				objObject.VAddCostLaborFixed13 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD].ToString().Trim());
				objObject.VAddCostLaborVariable14 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD].ToString().Trim());
				objObject.VAddCostOutsideProc15 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD].ToString().Trim());
				objObject.VAddCostAssemblyScrap16 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD].ToString().Trim());
				objObject.VAddCostShrink17 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTSHRINK17_FLD].ToString().Trim());
				objObject.VAddCostFreight18 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD].ToString().Trim());
				objObject.VAddCostUserStandard1_19 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD].ToString().Trim());
				objObject.VAddCostUserStandard2_20 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD].ToString().Trim());
				objObject.VAddCostTotalAmount21 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD].ToString().Trim());
				objObject.ComponentLaborRunHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD].ToString().Trim());
				objObject.ComponentLaborSetupHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD].ToString().Trim());
				objObject.ComponentMachineRunHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD].ToString().Trim());
				objObject.ComponentMachineSetupHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD].ToString().Trim());
				objObject.ValueAddedLaborRunHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD].ToString().Trim());
				objObject.ValueAddedLaborSetupHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD].ToString().Trim());
				objObject.ValueAddedMachineRunHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD].ToString().Trim());
				objObject.ValueAddedMachineSetupHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD].ToString().Trim());
				objObject.OperationLaborRunHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD].ToString().Trim());
				objObject.OperationLaborSetupHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD].ToString().Trim());
				objObject.OperationMachineRunHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD].ToString().Trim());
				objObject.OperationMachineSetupHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD].ToString().Trim());
				objObject.BCR = odrPCS[ITM_CostOperationTable.BCR_FLD].ToString().Trim();
				objObject.OperCostMaterial01 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD].ToString().Trim());
				objObject.OperCostMaterialOverHead02 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD].ToString().Trim());
				objObject.OperCostMachineSetup03 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD].ToString().Trim());
				objObject.OperCostMachineSetupFixed04 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD].ToString().Trim());
				objObject.OperCostMachineSetupVar05 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD].ToString().Trim());
				objObject.OperCostMachineRun06 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD].ToString().Trim());
				objObject.OperCostMachineFixed07 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD].ToString().Trim());
				objObject.OperCostMachineVariable08 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD].ToString().Trim());
				objObject.OperCostLaborSetup09 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD].ToString().Trim());
				objObject.OperCostLaborSetupFixed10 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD].ToString().Trim());
				objObject.OperCostLaborSetupVariable11 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD].ToString().Trim());
				objObject.OperCostLaborRun12 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD].ToString().Trim());
				objObject.OperCostLaborFixed13 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD].ToString().Trim());
				objObject.OperCostLaborVariable14 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD].ToString().Trim());
				objObject.OperCostOutsideProc15 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD].ToString().Trim());
				objObject.OperCostAssemblyScrap16 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD].ToString().Trim());
				objObject.OperCostShrink17 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTSHRINK17_FLD].ToString().Trim());
				objObject.OperCostFreight18 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD].ToString().Trim());
				objObject.OperCostUserStandard1_19 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD].ToString().Trim());
				objObject.OperCostUserStandard2_20 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD].ToString().Trim());
				objObject.OperCostTotalAmount21 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD].ToString().Trim());
				objObject.RoutingID = int.Parse(odrPCS[ITM_CostOperationTable.ROUTINGID_FLD].ToString().Trim());
				objObject.CCNID = int.Parse(odrPCS[ITM_CostOperationTable.CCNID_FLD].ToString().Trim());
				objObject.ProductID = int.Parse(odrPCS[ITM_CostOperationTable.PRODUCTID_FLD].ToString().Trim());

				}		
				return objObject;					
			}
			catch(OleDbException ex)
			{			
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}			

			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}
		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to get data from ITM_CostOperation
		///    </Description>
		///    <Inputs>
		///        ProductID, CCNID
		///    </Inputs>
		///    <Outputs>
		///       ITM_CostOperationVO
		///    </Outputs>
		///    <Returns>
		///       ITM_CostOperationVO
		///    </Returns>
		///    <Authors>
		///       DungLa
		///    </Authors>
		///    <History>
		///       01-Apr-2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************

		public object GetObjectVO(int pintRoutingID, int pintProductID, int pintCCNID)
		{
			const string METHOD_NAME = THIS + ".GetObjectVO()";
			
			OleDbDataReader odrPCS = null;
			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try 
			{
				string strSql = String.Empty;
				strSql=	"SELECT "
					+ ITM_CostOperationTable.COSTOPERATIONID_FLD + ","
					+ ITM_CostOperationTable.COMMATERIAL01_FLD + ","
					+ ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostOperationTable.COMMACHINESETUP03_FLD + ","
					+ ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD + ","
					+ ITM_CostOperationTable.COMMACHINERUN06_FLD + ","
					+ ITM_CostOperationTable.COMMACHINEFIXED07_FLD + ","
					+ ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD + ","
					+ ITM_CostOperationTable.COMLABORSETUP09_FLD + ","
					+ ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD + ","
					+ ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostOperationTable.COMLABORRUN12_FLD + ","
					+ ITM_CostOperationTable.COMLABORFIXED13_FLD + ","
					+ ITM_CostOperationTable.COMLABORVARIABLE14_FLD + ","
					+ ITM_CostOperationTable.COMOUTSIDEPROC15_FLD + ","
					+ ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostOperationTable.COMSHRINK17_FLD + ","
					+ ITM_CostOperationTable.COMFREIGHT18_FLD + ","
					+ ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD + ","
					+ ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD + ","
					+ ITM_CostOperationTable.COMTOTALAMOUNT21_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTSHRINK17_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD + ","
					+ ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD + ","
					+ ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD + ","
					+ ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD + ","
					+ ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD + ","
					+ ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD + ","
					+ ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD + ","
					+ ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD + ","
					+ ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD + ","
					+ ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD + ","
					+ ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD + ","
					+ ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD + ","
					+ ITM_CostOperationTable.BCR_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTSHRINK17_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostOperationTable.ROUTINGID_FLD + ","
					+ ITM_CostOperationTable.CCNID_FLD + ","
					+ ITM_CostOperationTable.PRODUCTID_FLD
					+ " FROM " + ITM_CostOperationTable.TABLE_NAME
					+ " WHERE " + ITM_CostOperationTable.CCNID_FLD + "=" + pintCCNID
					+ " AND " + ITM_CostOperationTable.PRODUCTID_FLD + "=" + pintProductID
					+ " AND " + ITM_CostOperationTable.ROUTINGID_FLD + "=" + pintRoutingID;

				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);

				ocmdPCS.Connection.Open();
				odrPCS = ocmdPCS.ExecuteReader();

				ITM_CostOperationVO objObject = new ITM_CostOperationVO();

				while (odrPCS.Read())
				{ 
					if (odrPCS[ITM_CostOperationTable.COSTOPERATIONID_FLD] != DBNull.Value)
						objObject.CostOperationID = int.Parse(odrPCS[ITM_CostOperationTable.COSTOPERATIONID_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMMATERIAL01_FLD] != DBNull.Value)
						objObject.ComMaterial01 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMATERIAL01_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD] != DBNull.Value)
						objObject.ComMaterialOverHead02 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMMATERIAL01_FLD] != DBNull.Value)
						objObject.ComMachineSetup03 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMACHINESETUP03_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD] != DBNull.Value)
						objObject.ComMachineSetupFixed04 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD] != DBNull.Value)
						objObject.ComMachineSetupVar05 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMMACHINERUN06_FLD] != DBNull.Value)
						objObject.ComMachineRun06 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMACHINERUN06_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMMACHINEFIXED07_FLD] != DBNull.Value)
						objObject.ComMachineFixed07 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMACHINEFIXED07_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD] != DBNull.Value)
						objObject.ComMachineVariable08 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMLABORSETUP09_FLD] != DBNull.Value)
						objObject.ComLaborSetup09 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMLABORSETUP09_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD] != DBNull.Value)
						objObject.ComLaborSetupFixed10 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD] != DBNull.Value)
						objObject.ComLaborSetupVariable11 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMLABORRUN12_FLD] != DBNull.Value)
						objObject.ComLaborRun12 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMLABORRUN12_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMLABORFIXED13_FLD] != DBNull.Value)
						objObject.ComLaborFixed13 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMLABORFIXED13_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMLABORVARIABLE14_FLD] != DBNull.Value)
						objObject.ComLaborVariable14 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMLABORVARIABLE14_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMOUTSIDEPROC15_FLD] != DBNull.Value)
						objObject.ComOutsideProc15 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMOUTSIDEPROC15_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD] != DBNull.Value)
						objObject.ComAssemblyScrap16 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMSHRINK17_FLD] != DBNull.Value)
						objObject.ComShrink17 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMSHRINK17_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMFREIGHT18_FLD] != DBNull.Value)
						objObject.ComFreight18 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMFREIGHT18_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD] != DBNull.Value)
						objObject.ComUserStandard1_19 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD] != DBNull.Value)
						objObject.ComUserStandard2_20 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMTOTALAMOUNT21_FLD] != DBNull.Value)
						objObject.ComTotalAmount21 = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMTOTALAMOUNT21_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD] != DBNull.Value)
						objObject.VAddCostMaterial01 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD] != DBNull.Value)
						objObject.VAddCostMaterialOverHead02 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD] != DBNull.Value)
						objObject.VAddCostMachineSetup03 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD] != DBNull.Value)
						objObject.VAddCostMachineSetupFixed04 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD] != DBNull.Value)
						objObject.VAddCostMachineSetupVar05 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD] != DBNull.Value)
						objObject.VAddCostMachineRun06 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD] != DBNull.Value)
						objObject.VAddCostMachineFixed07 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD] != DBNull.Value)
						objObject.VAddCostMachineVariable08 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD] != DBNull.Value)
						objObject.VAddCostLaborSetup09 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD] != DBNull.Value)
						objObject.VAddCostLaborSetupFixed10 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD] != DBNull.Value)
						objObject.VAddCostLaborSetupVariable11 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD] != DBNull.Value)
						objObject.VAddCostLaborRun12 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD] != DBNull.Value)
						objObject.VAddCostLaborFixed13 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD] != DBNull.Value)
						objObject.VAddCostLaborVariable14 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD] != DBNull.Value)
						objObject.VAddCostOutsideProc15 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD] != DBNull.Value)
						objObject.VAddCostAssemblyScrap16 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTSHRINK17_FLD] != DBNull.Value)
						objObject.VAddCostShrink17 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTSHRINK17_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD] != DBNull.Value)
						objObject.VAddCostFreight18 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD] != DBNull.Value)
						objObject.VAddCostUserStandard1_19 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD] != DBNull.Value)
						objObject.VAddCostUserStandard2_20 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD] != DBNull.Value)
						objObject.VAddCostTotalAmount21 = Decimal.Parse(odrPCS[ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD] != DBNull.Value)
						objObject.ComponentLaborRunHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD] != DBNull.Value)
						objObject.ComponentLaborSetupHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD] != DBNull.Value)
						objObject.ComponentMachineRunHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD] != DBNull.Value)
						objObject.ComponentMachineSetupHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD] != DBNull.Value)
						objObject.ValueAddedLaborRunHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD] != DBNull.Value)
						objObject.ValueAddedLaborSetupHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD] != DBNull.Value)
						objObject.ValueAddedMachineRunHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD] != DBNull.Value)
						objObject.ValueAddedMachineSetupHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD] != DBNull.Value)
						objObject.OperationLaborRunHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD] != DBNull.Value)
						objObject.OperationLaborSetupHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD] != DBNull.Value)
						objObject.OperationMachineRunHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD] != DBNull.Value)
						objObject.OperationMachineSetupHour = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD].ToString().Trim());
					objObject.BCR = odrPCS[ITM_CostOperationTable.BCR_FLD].ToString().Trim();
					if (odrPCS[ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD] != DBNull.Value)
						objObject.OperCostMaterial01 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD] != DBNull.Value)
						objObject.OperCostMaterialOverHead02 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD] != DBNull.Value)
						objObject.OperCostMachineSetup03 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD] != DBNull.Value)
						objObject.OperCostMachineSetupFixed04 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD] != DBNull.Value)
						objObject.OperCostMachineSetupVar05 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD] != DBNull.Value)
						objObject.OperCostMachineRun06 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD] != DBNull.Value)
						objObject.OperCostMachineFixed07 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD] != DBNull.Value)
						objObject.OperCostMachineVariable08 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD] != DBNull.Value)
						objObject.OperCostLaborSetup09 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD] != DBNull.Value)
						objObject.OperCostLaborSetupFixed10 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD] != DBNull.Value)
						objObject.OperCostLaborSetupVariable11 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD] != DBNull.Value)
						objObject.OperCostLaborRun12 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD] != DBNull.Value)
						objObject.OperCostLaborFixed13 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD] != DBNull.Value)
						objObject.OperCostLaborVariable14 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD] != DBNull.Value)
						objObject.OperCostOutsideProc15 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD] != DBNull.Value)
						objObject.OperCostAssemblyScrap16 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTSHRINK17_FLD] != DBNull.Value)
						objObject.OperCostShrink17 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTSHRINK17_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD] != DBNull.Value)
						objObject.OperCostFreight18 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD] != DBNull.Value)
						objObject.OperCostUserStandard1_19 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD] != DBNull.Value)
						objObject.OperCostUserStandard2_20 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD] != DBNull.Value)
						objObject.OperCostTotalAmount21 = Decimal.Parse(odrPCS[ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.ROUTINGID_FLD] != DBNull.Value)
						objObject.RoutingID = int.Parse(odrPCS[ITM_CostOperationTable.ROUTINGID_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.CCNID_FLD] != DBNull.Value)
						objObject.CCNID = int.Parse(odrPCS[ITM_CostOperationTable.CCNID_FLD].ToString().Trim());
					if (odrPCS[ITM_CostOperationTable.PRODUCTID_FLD] != DBNull.Value)
						objObject.ProductID = int.Parse(odrPCS[ITM_CostOperationTable.PRODUCTID_FLD].ToString().Trim());

				}		
				return objObject;					
			}
			catch(OleDbException ex)
			{			
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}			

			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}
		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to update data to ITM_CostOperation
		///    </Description>
		///    <Inputs>
		///       ITM_CostOperationVO       
		///    </Inputs>
		///    <Outputs>
		///       
		///    </Outputs>
		///    <Returns>
		///       
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       09-Dec-2004
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		
	
		public void Update(object pobjObjecVO)
		{
			const string METHOD_NAME = THIS + ".Update()";

			ITM_CostOperationVO objObject = (ITM_CostOperationVO) pobjObjecVO;
			

			//prepare value for parameters
			OleDbConnection oconPCS =null;
			OleDbCommand ocmdPCS = null;
			try 
			{
				string strSql = String.Empty;
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);
				strSql=	"UPDATE ITM_CostOperation SET "
				+ ITM_CostOperationTable.COMMATERIAL01_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMMACHINESETUP03_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMMACHINERUN06_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMMACHINEFIXED07_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMLABORSETUP09_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMLABORRUN12_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMLABORFIXED13_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMLABORVARIABLE14_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMOUTSIDEPROC15_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMSHRINK17_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMFREIGHT18_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMTOTALAMOUNT21_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTSHRINK17_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.BCR_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTSHRINK17_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.ROUTINGID_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.CCNID_FLD + "=   ?" + ","
				+ ITM_CostOperationTable.PRODUCTID_FLD + "=  ?"
				+" WHERE " + ITM_CostOperationTable.COSTOPERATIONID_FLD + "= ?";

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMATERIAL01_FLD].Value = objObject.ComMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD].Value = objObject.ComMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINESETUP03_FLD].Value = objObject.ComMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD].Value = objObject.ComMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD].Value = objObject.ComMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINERUN06_FLD].Value = objObject.ComMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINEFIXED07_FLD].Value = objObject.ComMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD].Value = objObject.ComMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORSETUP09_FLD].Value = objObject.ComLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD].Value = objObject.ComLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD].Value = objObject.ComLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORRUN12_FLD].Value = objObject.ComLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORFIXED13_FLD].Value = objObject.ComLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMLABORVARIABLE14_FLD].Value = objObject.ComLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMOUTSIDEPROC15_FLD].Value = objObject.ComOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD].Value = objObject.ComAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMSHRINK17_FLD].Value = objObject.ComShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMFREIGHT18_FLD].Value = objObject.ComFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD].Value = objObject.ComUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD].Value = objObject.ComUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMTOTALAMOUNT21_FLD].Value = objObject.ComTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD].Value = objObject.VAddCostMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD].Value = objObject.VAddCostMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD].Value = objObject.VAddCostMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD].Value = objObject.VAddCostMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD].Value = objObject.VAddCostMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD].Value = objObject.VAddCostMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD].Value = objObject.VAddCostMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD].Value = objObject.VAddCostMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD].Value = objObject.VAddCostLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD].Value = objObject.VAddCostLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD].Value = objObject.VAddCostLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD].Value = objObject.VAddCostLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD].Value = objObject.VAddCostLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD].Value = objObject.VAddCostLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD].Value = objObject.VAddCostOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD].Value = objObject.VAddCostAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTSHRINK17_FLD].Value = objObject.VAddCostShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD].Value = objObject.VAddCostFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD].Value = objObject.VAddCostUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD].Value = objObject.VAddCostUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD].Value = objObject.VAddCostTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD].Value = objObject.ComponentLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD].Value = objObject.ComponentLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD].Value = objObject.ComponentMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD].Value = objObject.ComponentMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD].Value = objObject.ValueAddedLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD].Value = objObject.ValueAddedLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD].Value = objObject.ValueAddedMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD].Value = objObject.ValueAddedMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD].Value = objObject.OperationLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD].Value = objObject.OperationLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD].Value = objObject.OperationMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD].Value = objObject.OperationMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.BCR_FLD, OleDbType.VarChar));
				ocmdPCS.Parameters[ITM_CostOperationTable.BCR_FLD].Value = objObject.BCR;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD].Value = objObject.OperCostMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD].Value = objObject.OperCostMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD].Value = objObject.OperCostMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD].Value = objObject.OperCostMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD].Value = objObject.OperCostMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD].Value = objObject.OperCostMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD].Value = objObject.OperCostMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD].Value = objObject.OperCostMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD].Value = objObject.OperCostLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD].Value = objObject.OperCostLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD].Value = objObject.OperCostLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD].Value = objObject.OperCostLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD].Value = objObject.OperCostLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD].Value = objObject.OperCostLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD].Value = objObject.OperCostOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD].Value = objObject.OperCostAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTSHRINK17_FLD].Value = objObject.OperCostShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD].Value = objObject.OperCostFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD].Value = objObject.OperCostUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD].Value = objObject.OperCostUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD].Value = objObject.OperCostTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.ROUTINGID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostOperationTable.ROUTINGID_FLD].Value = objObject.RoutingID;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.CCNID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostOperationTable.CCNID_FLD].Value = objObject.CCNID;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.PRODUCTID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostOperationTable.PRODUCTID_FLD].Value = objObject.ProductID;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostOperationTable.COSTOPERATIONID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostOperationTable.COSTOPERATIONID_FLD].Value = objObject.CostOperationID;


				ocmdPCS.CommandText = strSql;
				ocmdPCS.Connection.Open();
				ocmdPCS.ExecuteNonQuery();	
			}
			catch(OleDbException ex)
			{
				if (ex.Errors[1].NativeError == ErrorCode.SQLDUPLICATE_KEYCODE)
				{
																   
					throw new PCSDBException(ErrorCode.DUPLICATE_KEY, METHOD_NAME, ex);				
				}
				else
				{
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
				}
			}			

			catch(InvalidOperationException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}
			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}

		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to get all data from ITM_CostOperation
		///    </Description>
		///    <Inputs>
		///               
		///    </Inputs>
		///    <Outputs>
		///       DataSet
		///    </Outputs>
		///    <Returns>
		///       DataSet
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************

		public DataSet List()
		{
			const string METHOD_NAME = THIS + ".List()";
			DataSet dstPCS = new DataSet();
			
		

			OleDbConnection oconPCS =null;
			OleDbCommand ocmdPCS = null;
			try 
			{
				string strSql = String.Empty;
				
				strSql=	"SELECT "
				+ ITM_CostOperationTable.COSTOPERATIONID_FLD + ","
				+ ITM_CostOperationTable.COMMATERIAL01_FLD + ","
				+ ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD + ","
				+ ITM_CostOperationTable.COMMACHINESETUP03_FLD + ","
				+ ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD + ","
				+ ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD + ","
				+ ITM_CostOperationTable.COMMACHINERUN06_FLD + ","
				+ ITM_CostOperationTable.COMMACHINEFIXED07_FLD + ","
				+ ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD + ","
				+ ITM_CostOperationTable.COMLABORSETUP09_FLD + ","
				+ ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD + ","
				+ ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD + ","
				+ ITM_CostOperationTable.COMLABORRUN12_FLD + ","
				+ ITM_CostOperationTable.COMLABORFIXED13_FLD + ","
				+ ITM_CostOperationTable.COMLABORVARIABLE14_FLD + ","
				+ ITM_CostOperationTable.COMOUTSIDEPROC15_FLD + ","
				+ ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD + ","
				+ ITM_CostOperationTable.COMSHRINK17_FLD + ","
				+ ITM_CostOperationTable.COMFREIGHT18_FLD + ","
				+ ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD + ","
				+ ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD + ","
				+ ITM_CostOperationTable.COMTOTALAMOUNT21_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTSHRINK17_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD + ","
				+ ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD + ","
				+ ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD + ","
				+ ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.BCR_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTSHRINK17_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD + ","
				+ ITM_CostOperationTable.ROUTINGID_FLD + ","
				+ ITM_CostOperationTable.CCNID_FLD + ","
				+ ITM_CostOperationTable.PRODUCTID_FLD
					+ " FROM " + ITM_CostOperationTable.TABLE_NAME;
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);
				ocmdPCS.Connection.Open();
				
				OleDbDataAdapter odadPCS = new OleDbDataAdapter(ocmdPCS);
				odadPCS.Fill(dstPCS,ITM_CostOperationTable.TABLE_NAME);

				return dstPCS;
			}
			catch(OleDbException ex)
			{
   				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}			
			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}


		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to get all data from ITM_CostOperation
		///    </Description>
		///    <Inputs>
		///               
		///    </Inputs>
		///    <Outputs>
		///       DataSet
		///    </Outputs>
		///    <Returns>
		///       DataSet
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************

		public DataTable GetCostOperation(int pintProductID, int pintCCNID)
		{
			const string METHOD_NAME = THIS + ".GetCostOperation()";
			DataSet dstPCS = new DataSet();
			
			OleDbConnection oconPCS =null;
			OleDbCommand ocmdPCS = null;
			try 
			{
				string strSql = String.Empty;
				
				strSql=	"SELECT "
					+ " SUM(" + ITM_CostOperationTable.COMMATERIAL01_FLD  + ") as " + ITM_CostOperationTable.COMMATERIAL01_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD + ") as " + ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMMACHINESETUP03_FLD + ") as " + ITM_CostOperationTable.COMMACHINESETUP03_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD + ") as " + ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD + ") as " + ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMMACHINERUN06_FLD + ") as " + ITM_CostOperationTable.COMMACHINERUN06_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMMACHINEFIXED07_FLD + ") as " + ITM_CostOperationTable.COMMACHINEFIXED07_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD + ") as " + ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMLABORSETUP09_FLD + ") as " + ITM_CostOperationTable.COMLABORSETUP09_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD + ") as " + ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD + ") as " + ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMLABORRUN12_FLD + ") as " + ITM_CostOperationTable.COMLABORRUN12_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMLABORFIXED13_FLD + ") as " + ITM_CostOperationTable.COMLABORFIXED13_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMLABORVARIABLE14_FLD + ") as " + ITM_CostOperationTable.COMLABORVARIABLE14_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMOUTSIDEPROC15_FLD + ") as " + ITM_CostOperationTable.COMOUTSIDEPROC15_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD + ") as " + ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMSHRINK17_FLD + ") as " + ITM_CostOperationTable.COMSHRINK17_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMFREIGHT18_FLD + ") as " + ITM_CostOperationTable.COMFREIGHT18_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD + ") as " + ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD + ") as " + ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMTOTALAMOUNT21_FLD + ") as " + ITM_CostOperationTable.COMTOTALAMOUNT21_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD + ") as " + ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD + ") as " + ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD + ") as " + ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD + ") as " + ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD + ") as " + ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD + ") as " + ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD + ") as " + ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD + ") as " + ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD + ") as " + ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD + ") as " + ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD + ") as " + ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD + ") as " + ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD + ") as " + ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD + ") as " + ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD + ") as " + ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD + ") as " + ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTSHRINK17_FLD + ") as " + ITM_CostOperationTable.VADDCOSTSHRINK17_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD + ") as " + ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD + ") as " + ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD + ") as " + ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD + ") as " + ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD + ") as " + ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD + ") as " + ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD + ") as " + ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD + ") as " + ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD + ") as " + ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD + ") as " + ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD + ") as " + ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD + ") as " + ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD + ") as " + ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD + ") as " + ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD + ") as " + ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD + ") as " + ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD + ") as " + ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD + ") as " + ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD + ") as " + ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD + ") as " + ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTSHRINK17_FLD + ") as " + ITM_CostOperationTable.OPERCOSTSHRINK17_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD + ") as " + ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD + ") as " + ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD + ") as " + ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD + ") as " + ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD 
					+ " FROM " + ITM_CostOperationTable.TABLE_NAME
					+ " WHERE " + ITM_CostOperationTable.CCNID_FLD + " = " + pintCCNID 
					+ " AND " + ITM_CostOperationTable.PRODUCTID_FLD + "=" + pintProductID;


				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);
				ocmdPCS.Connection.Open();
				
				OleDbDataAdapter odadPCS = new OleDbDataAdapter(ocmdPCS);
				odadPCS.Fill(dstPCS,ITM_CostOperationTable.TABLE_NAME);

				return dstPCS.Tables[0];
			}
			catch(OleDbException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}			
			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}


		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to get all data from ITM_CostOperation
		///    </Description>
		///    <Inputs>
		///               
		///    </Inputs>
		///    <Outputs>
		///       DataSet
		///    </Outputs>
		///    <Returns>
		///       DataSet
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************

		public DataTable GetCostItemMaintenance(int pintProductID, int pintCCNID)
		{
			const string METHOD_NAME = THIS + ".GetCostItemMaintenance()";
			DataSet dstPCS = new DataSet();
			
			OleDbConnection oconPCS =null;
			OleDbCommand ocmdPCS = null;
			try 
			{
				string strSql = String.Empty;
				
				strSql=	"SELECT "
					+ ITM_RoutingTable.TABLE_NAME + "." + ITM_RoutingTable.STEP_FLD + "," 
					+ ITM_CostOperationTable.TABLE_NAME + "." + ITM_CostOperationTable.COMTOTALAMOUNT21_FLD  + ","
					+ ITM_CostOperationTable.TABLE_NAME + "." + ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD  + ","
					+ ITM_CostOperationTable.TABLE_NAME + "." + ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD  
					+ " FROM " + ITM_CostOperationTable.TABLE_NAME 
					+ " RIGHT JOIN " + ITM_RoutingTable.TABLE_NAME 
					+ " ON "  + ITM_CostOperationTable.TABLE_NAME + "." + ITM_CostOperationTable.ROUTINGID_FLD 
					+ " = "  + ITM_RoutingTable.TABLE_NAME + "." + ITM_RoutingTable.ROUTINGID_FLD 
 					+ " WHERE " + ITM_CostOperationTable.TABLE_NAME + "." + ITM_CostOperationTable.CCNID_FLD + " = " + pintCCNID 
					+ " AND "   + ITM_CostOperationTable.TABLE_NAME + "." + ITM_CostOperationTable.PRODUCTID_FLD + "=" + pintProductID;


				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);
				ocmdPCS.Connection.Open();
				
				OleDbDataAdapter odadPCS = new OleDbDataAdapter(ocmdPCS);
				odadPCS.Fill(dstPCS,ITM_CostOperationTable.TABLE_NAME);

				return dstPCS.Tables[0];
			}
			catch(OleDbException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}			
			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}


		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to get all data from ITM_CostOperation
		///    </Description>
		///    <Inputs>
		///               
		///    </Inputs>
		///    <Outputs>
		///       DataSet
		///    </Outputs>
		///    <Returns>
		///       DataSet
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************

		public DataTable GetHourCostOperation(int pintProductID, int pintCCNID)
		{
			const string METHOD_NAME = THIS + ".GetHourCostOperation()";
			DataSet dstPCS = new DataSet();
			
			OleDbConnection oconPCS =null;
			OleDbCommand ocmdPCS = null;
			try 
			{
				string strSql = String.Empty;
				/*
					select 

					sum(ComponentLaborRunHour),
					sum(ComponentLaborSetupHour),
					Sum(ComponentMachineRunHour) ,
					Sum(ComponentMachineSetupHour) ,
					Sum(ValueAddedLaborRunHour) ,
					Sum(ValueAddedLaborSetupHour) ,
					
					Sum(ValueAddedMachineRunHour) ,
					
					Sum(ValueAddedMachineSetupHour) ,
					
					Sum(OperationLaborRunHour) ,
					Sum(OperationLaborSetupHour) ,
					Sum(OperationMachineRunHour) ,
					Sum(OperationMachineSetupHour) 


					from ITM_CostOperation  where ProductID= ?
					and  CCNID=?				
				*/
				strSql=	"SELECT "
					+ " SUM(" + ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD  + ") as " + ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD + ") as " + ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD + ") as " + ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD + ") as " + ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD + ") as " + ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD + ") as " + ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD + ") as " + ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD + ") as " + ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD + ") as " + ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD + ") as " + ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD + ") as " + ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD  + ","
					+ " SUM(" + ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD + ") as " + ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD
					+ " FROM " + ITM_CostOperationTable.TABLE_NAME
					+ " WHERE " + ITM_CostOperationTable.CCNID_FLD + " = " + pintCCNID 
					+ " AND " + ITM_CostOperationTable.PRODUCTID_FLD + "=" + pintProductID;


				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);
				ocmdPCS.Connection.Open();
				
				OleDbDataAdapter odadPCS = new OleDbDataAdapter(ocmdPCS);
				odadPCS.Fill(dstPCS,ITM_CostOperationTable.TABLE_NAME);

				return dstPCS.Tables[0];
			}
			catch(OleDbException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}			
			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}


		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to update a DataSet
		///    </Description>
		///    <Inputs>
		///        DataSet       
		///    </Inputs>
		///    <Outputs>
		///       
		///    </Outputs>
		///    <Returns>
		///       
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		
		public void UpdateDataSet(DataSet pData)
		{
			const string METHOD_NAME = THIS + ".UpdateDataSet()";
			string strSql;
			OleDbConnection oconPCS =null;
			OleDbCommandBuilder odcbPCS ;
			OleDbDataAdapter odadPCS = new OleDbDataAdapter();

			try
			{
				strSql=	"SELECT "
				+ ITM_CostOperationTable.COSTOPERATIONID_FLD + ","
				+ ITM_CostOperationTable.COMMATERIAL01_FLD + ","
				+ ITM_CostOperationTable.COMMATERIALOVERHEAD02_FLD + ","
				+ ITM_CostOperationTable.COMMACHINESETUP03_FLD + ","
				+ ITM_CostOperationTable.COMMACHINESETUPFIXED04_FLD + ","
				+ ITM_CostOperationTable.COMMACHINESETUPVAR05_FLD + ","
				+ ITM_CostOperationTable.COMMACHINERUN06_FLD + ","
				+ ITM_CostOperationTable.COMMACHINEFIXED07_FLD + ","
				+ ITM_CostOperationTable.COMMACHINEVARIABLE08_FLD + ","
				+ ITM_CostOperationTable.COMLABORSETUP09_FLD + ","
				+ ITM_CostOperationTable.COMLABORSETUPFIXED10_FLD + ","
				+ ITM_CostOperationTable.COMLABORSETUPVARIABLE11_FLD + ","
				+ ITM_CostOperationTable.COMLABORRUN12_FLD + ","
				+ ITM_CostOperationTable.COMLABORFIXED13_FLD + ","
				+ ITM_CostOperationTable.COMLABORVARIABLE14_FLD + ","
				+ ITM_CostOperationTable.COMOUTSIDEPROC15_FLD + ","
				+ ITM_CostOperationTable.COMASSEMBLYSCRAP16_FLD + ","
				+ ITM_CostOperationTable.COMSHRINK17_FLD + ","
				+ ITM_CostOperationTable.COMFREIGHT18_FLD + ","
				+ ITM_CostOperationTable.COMUSERSTANDARD1_19_FLD + ","
				+ ITM_CostOperationTable.COMUSERSTANDARD2_20_FLD + ","
				+ ITM_CostOperationTable.COMTOTALAMOUNT21_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMATERIAL01_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMATERIALOVERHEAD02_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUP03_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUPFIXED04_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINESETUPVAR05_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINERUN06_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINEFIXED07_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTMACHINEVARIABLE08_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUP09_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUPFIXED10_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORSETUPVARIABLE11_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORRUN12_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORFIXED13_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTLABORVARIABLE14_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTOUTSIDEPROC15_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTASSEMBLYSCRAP16_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTSHRINK17_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTFREIGHT18_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD1_19_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTUSERSTANDARD2_20_FLD + ","
				+ ITM_CostOperationTable.VADDCOSTTOTALAMOUNT21_FLD + ","
				+ ITM_CostOperationTable.COMPONENTLABORRUNHOUR_FLD + ","
				+ ITM_CostOperationTable.COMPONENTLABORSETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.COMPONENTMACHINERUNHOUR_FLD + ","
				+ ITM_CostOperationTable.COMPONENTMACHINESETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDLABORRUNHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDLABORSETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDMACHINERUNHOUR_FLD + ","
				+ ITM_CostOperationTable.VALUEADDEDMACHINESETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONLABORRUNHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONLABORSETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONMACHINERUNHOUR_FLD + ","
				+ ITM_CostOperationTable.OPERATIONMACHINESETUPHOUR_FLD + ","
				+ ITM_CostOperationTable.BCR_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMATERIAL01_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMATERIALOVERHEAD02_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUP03_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUPFIXED04_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINESETUPVAR05_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINERUN06_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINEFIXED07_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTMACHINEVARIABLE08_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUP09_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUPFIXED10_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORSETUPVARIABLE11_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORRUN12_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORFIXED13_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTLABORVARIABLE14_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTOUTSIDEPROC15_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTASSEMBLYSCRAP16_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTSHRINK17_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTFREIGHT18_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD1_19_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTUSERSTANDARD2_20_FLD + ","
				+ ITM_CostOperationTable.OPERCOSTTOTALAMOUNT21_FLD + ","
				+ ITM_CostOperationTable.ROUTINGID_FLD + ","
				+ ITM_CostOperationTable.CCNID_FLD + ","
				+ ITM_CostOperationTable.PRODUCTID_FLD 
		+ "  FROM " + ITM_CostOperationTable.TABLE_NAME;

				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				odadPCS.SelectCommand = new OleDbCommand(strSql, oconPCS);
				odcbPCS = new OleDbCommandBuilder(odadPCS);
				pData.EnforceConstraints = false;
				odadPCS.Update(pData,ITM_CostOperationTable.TABLE_NAME);

			}
			catch(OleDbException ex)
			{
				if (ex.Errors[1].NativeError == ErrorCode.SQLDUPLICATE_KEYCODE)
				{
																   
					throw new PCSDBException(ErrorCode.DUPLICATE_KEY, METHOD_NAME, ex);				
				}
				else if (ex.Errors[1].NativeError == ErrorCode.SQLCASCADE_PREVENT_KEYCODE)
				{

					throw new PCSDBException(ErrorCode.CASCADE_DELETE_PREVENT, METHOD_NAME, ex);				
				}
				
				else
				{
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
				}
			}			

			catch(InvalidOperationException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}
			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}

		}

		//**************************************************************************              
		///    <Description>
		///       This method uses to update a DataSet
		///    </Description>
		///    <Inputs>
		///        DataSet       
		///    </Inputs>
		///    <Outputs>
		///       
		///    </Outputs>
		///    <Returns>
		///       
		///    </Returns>
		///    <Authors>
		///       TraDa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public void Delete(int pintCCNID, int pintProductID)
		{
			const string METHOD_NAME = THIS + ".Delete()";
			string strSql = String.Empty;
			strSql=	"DELETE " + ITM_CostOperationTable.TABLE_NAME 
				+ " WHERE  " + ITM_CostOperationTable.CCNID_FLD + " = " + pintCCNID.ToString() 
				+ " AND " + ITM_CostOperationTable.PRODUCTID_FLD + " = " + pintProductID.ToString();
					
			OleDbConnection oconPCS=null;
			OleDbCommand ocmdPCS =null;
			try
			{
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);

				ocmdPCS.Connection.Open();
				ocmdPCS.ExecuteNonQuery();	
				ocmdPCS = null;

			}
			catch(OleDbException ex)
			{
				if (ex.Errors[1].NativeError == ErrorCode.SQLCASCADE_PREVENT_KEYCODE)
				{
																   
					throw new PCSDBException(ErrorCode.CASCADE_DELETE_PREVENT, METHOD_NAME, ex);				
				}
				else
				{
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
				}
			}			

			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}



			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}
		}
	
		//**************************************************************************              
		///    <Description>
		///       This method uses to delete record from ITM_CostOperation
		///    </Description>
		///    <Inputs>
		///        CCNID, ProductID, RoutingID
		///    </Inputs>
		///    <Outputs>
		///       
		///    </Outputs>
		///    <Returns>
		///       
		///    </Returns>
		///    <Authors>
		///       DungLa
		///    </Authors>
		///    <History>
		///       01-Apr, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public void Delete(int pintCCNID, int pintProductID, int pintRoutingID)
		{
			const string METHOD_NAME = THIS + ".Delete()";
			string strSql = String.Empty;
			strSql=	"DELETE " + ITM_CostOperationTable.TABLE_NAME 
				+ " WHERE  " + ITM_CostOperationTable.CCNID_FLD + " = " + pintCCNID.ToString() 
				+ " AND " + ITM_CostOperationTable.PRODUCTID_FLD + " = " + pintProductID.ToString()
				+ " AND " + ITM_CostOperationTable.ROUTINGID_FLD + " = " + pintRoutingID.ToString();
					
			OleDbConnection oconPCS=null;
			OleDbCommand ocmdPCS =null;
			try
			{
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);

				ocmdPCS.Connection.Open();
				ocmdPCS.ExecuteNonQuery();	
				ocmdPCS = null;

			}
			catch(OleDbException ex)
			{
				if (ex.Errors[1].NativeError == ErrorCode.SQLCASCADE_PREVENT_KEYCODE)
				{
																   
					throw new PCSDBException(ErrorCode.CASCADE_DELETE_PREVENT, METHOD_NAME, ex);				
				}
				else
				{
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
				}
			}			

			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}



			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}
		}
	
	
	}
}
